package my.study.java.lang.reflect.Proxy.examples;

public class Main1 {
	public static void consumer(Animal iface) {
		iface.eat();
		iface.shout("bonobo");
	}
	/**
	 * 使用组合实现简单的代理
	 * @param args
	 */
	public static void main(String[] args) {
		consumer(new Dog());
		consumer(new SimpleAnimalProxy(new Dog()));
		consumer(SimpleAnimalProxy.createProxy(Dog.class));
	}

}
